package com.gitee.oauth2.authentication.oauth2authentication.login;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LoginController {

    private final static Logger LOG = LoggerFactory.getLogger(LoginController.class);

    @RequestMapping("/login-gitee")
    public ModelAndView loginGitee(ModelAndView mv){
        mv.setViewName("/loginGitee");
        return mv;
    }

    @RequestMapping("/login")
    @ResponseBody
    public String login(@RequestParam(value = "code") String code){
        LOG.info(code);
        return "gitee 登录成功";

    }
}
